package com.yqya.alibaba.nacos.discovery.client;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.reactive.function.client.WebClient;

/**
 * 应用入口
 *
 * @author Kevin
 * @date 2019-07-08
 */
@EnableDiscoveryClient
@SpringBootApplication
public class NacosDiscoveryClientWebClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(NacosDiscoveryClientWebClientApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public WebClient.Builder loadBalancedWebClientBuilder() {
        // 理解为reactive版的RestTemplate
        return WebClient.builder();
    }
}
